package com.webgis.backendservice.controller;

import com.webgis.backendservice.pojo.User;
import com.webgis.backendservice.service.UserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


@Slf4j
@RestController
@CrossOrigin //跨域
public class UserController {
    @Autowired
    private UserService userService;

    @PostMapping ("user/login")
    public int login(@RequestBody User user){
        return userService.login(user);
    }

    @PostMapping ("user/register")
    public int register(@RequestBody User user){
        return userService.register(user);
    }
}
